package controller;

import dao.UserMapper;
import model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import service.UserService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Tyler on 2017/6/20.
 */

@Controller
@RequestMapping("test")
public class TestController {

    @Autowired
    protected UserMapper service;
    protected UserService userService;

    @RequestMapping(value = "test.do")
    public ModelAndView test1() throws Exception {

        Integer uid = 1;
        User user = userService.selectByPrimaryKey(uid);
        return new ModelAndView("test/test.jsp","user",user);
    }
}

